{% load static %}
<!DOCTYPE html>
<!-- saved from url=(0075)http://demo.wcpdoc.com/webdoc/view/Pub2c902a8d6dc8c1da016dc9c039e80457.html -->
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--<base href="http://demo.wcpdoc.com:80/">--><base href=".">
<title>{{ article.title }}</title>

<!--<base href="http://demo.wcpdoc.com:80/">--><base href=".">

<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">

<script type="text/javascript" src='{% static "js/jquery-1.8.0.min.js" %}'></script>
<link href='{% static "css/bootstrap.min.css" %}' rel="stylesheet">

<link href='{% static "css/bootstrap-theme.min.css" %}' rel="stylesheet">
<script type="text/javascript" src='{% static "js/bootstrap.min.js" %}'></script>
<script type="text/javascript" src='{% static "js/respond.min.js" %}'></script>

<link href='{% static "css/web-base.css" %}' rel="stylesheet">

<link href='{% static "css/web-black.css" %}' rel="stylesheet">
<link href='{% static "css/editInner.css" %}' rel="stylesheet">

<script type="text/javascript">
	var basePath = 'http://demo.wcpdoc.com:80/';
	$(function() {
		$.ajaxSetup({
			cache : false
		});
	})
//-->
</script>
<link href='{% static "css/buttons.css" %}' rel="stylesheet">
</head>

<body>
	




<!-- class="navbar navbar-default|navbar-inverse" -->
<style>
<!--
.imgMenuIcon {
	width: 16px;
	height: 16px;
	margin-right: 4px;
	margin-left: -2px;
	margin-top: -2px;
}
-->
</style>

{% include "navbar.html" %}

<script>
	//初始化判断如果页面在iframe中则不显示head和foot
	initIframeStyle();
	$(function() {
		initIframeStyle();
	});
	function initIframeStyle() {
		if (self != top) {
			$('.navbar').hide();
			$('.super_content').hide();
			$('.super_contentfoot').remove();
			$('.foot').hide();
			$('.wcp-doc-rsg').hide();
			$('.wcp-doc-operate').children().hide();
			$('.wcp-doc-operate').append('<a class="btn btn-default  btn-xs" target="_blank" href="'+window.location.href+'"><span class="glyphicon glyphicon-new-window"></span> &nbsp;新窗口打开</a>');
			$('.towcodeTooltipfalg').hide();  
		}
	}
</script>


<!-- 确认框和提示框组件，使用方法在最下方！confirm和alert的bootstrap实现 -->
<div id="ycf-alert" class="modal">
	<div class="modal-dialog modal-sm">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal">
					<span aria-hidden="true">×</span><span class="sr-only">Close</span>
				</button>
				<h5 class="modal-title">
					<i class="fa fa-exclamation-circle"></i> [Title]
				</h5>
			</div>
			<div class="modal-body small">
				<p>[Message]</p>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-primary ok" data-dismiss="modal">[BtnOk]</button>
				<button type="button" class="btn btn-default cancel" data-dismiss="modal">[BtnCancel]</button>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	//Modal.alert({msg: '内容',title: '标题',btnok: '确定',btncl:'取消'});
	//Modal.confirm({msg : "是否删除角色？"}).on(function(e) {alert("返回结果：" + e);});
	$(function() {
		//控制内容中的图片，在缩放情况下不变形
		$('#docContentsId img').attr('height',''); 
		window.Modal = function() {
			var reg = new RegExp("\\[([^\\[\\]]*?)\\]", 'igm');
			var alr = $("#ycf-alert");
			var ahtml = alr.html();
			var _alert = function(options) {
				alr.html(ahtml); // 复原
				alr.find('.ok').removeClass('btn-primary').addClass(
						'btn-primary');
				alr.find('.cancel').hide();
				_dialog(options);

				return {
					on : function(callback) {
						if (callback && callback instanceof Function) {
							alr.find('.ok').click(function() {
								callback(true)
							});
						}
					}
				};
			};
			var _confirm = function(options) {
				alr.html(ahtml); // 复原
				alr.find('.ok').removeClass('btn-primary').addClass(
						'btn-primary');
				alr.find('.cancel').show();
				_dialog(options);
				return {
					on : function(callback) {
						if (callback && callback instanceof Function) {
							alr.find('.ok').click(function() {
								callback(true)
							});
							alr.find('.cancel').click(function() {
								callback(false)
							});
						}
					}
				};
			};
			var _dialog = function(options) {
				var ops = {
					msg : "提示内容",
					title : "操作提示",
					btnok : "确定",
					btncl : "取消"
				};
				$.extend(ops, options);
				console.log(alr);
				var html = alr.html().replace(reg, function(node, key) {
					return {
						Title : ops.title,
						Message : ops.msg,
						BtnOk : ops.btnok,
						BtnCancel : ops.btncl
					}[key];
				});

				alr.html(html);
				alr.modal({
					width : 500,
					backdrop : 'static'
				});
			}
			return {
				alert : _alert,
				confirm : _confirm
			}
		}();
	});
</script>
<!-- system modal end -->
<script type="text/javascript">
	function luceneSearch(key) {
		$('#wordId').val(key);
		$('#lucenesearchFormId').submit();
	}
	function luceneSearchGo(page) {
		$('#pageNumId').val(page);
		$('#lucenesearchFormId').submit();
	}
//-->
</script>


	


<div class="super_content">
</div> 
	<div class="containerbox" style="min-height: 397px;">
		<div class="container ">
			<div class="row" style="margin-top: 20px;">
				<div class="col-md-10 clear-both">
					<div class="panel panel-default view-left-content">
						<div class="panel-body">
							<!-- 知识正文 -->
							



<style>
<!--
.inner-img {
	cursor: pointer;
}
-->
</style>
<div class="row">
	<div class="col-md-12">
		
			



<!-- 如果是内容类型等于4小组首页，则在此处不提供任何操作功能1.HTML文档(知识)，5资源文件,6资源URL 4小组首页,7专题首页 -->

	
	
		<div style="padding: 2px;" class="visible-lg visible-md">
			<div class="btn-group wcp-doc-operate" role="group" aria-label="...">
				
				
			</div>
			<div class="pull-right">
				&nbsp; <span class="badge" title="访问量"> <span class="glyphicon glyphicon-hand-up"></span>
                    &nbsp;{{ article.view_count }}
				</span> &nbsp; 
			</div>
			<div class="pull-right">
				&nbsp; <a href=""> <span class="badge" title="评论"> <span class="glyphicon glyphicon-comment"></span>
                        &nbsp;{{ article.comment_set.count }}
				</span>
				</a>
			</div>
		</div>
	

<script type="text/javascript">
	$(function() {
		$('#editTopButtonId').bind('click', function() {
			window.location = basePath + 'know/edit.do?docid=2c902a8d6dc8c1da016dc9c039e80457';
		});
		$('#editImgTopButtonId').bind(
				'click',
				function() {
					window.location = basePath
							+ 'webdoc/editImg.do?docid=2c902a8d6dc8c1da016dc9c039e80457';
				});
		$('#editRelationKnowButtonId').bind(
				'click',
				function() {
					window.location = basePath
							+ 'webdoc/editRelationDoc.do?docid=2c902a8d6dc8c1da016dc9c039e80457';
				});
		//设置知识分类和标签
		$('#editTypeAndTagButtonId').bind(
				'click',
				function() {
					window.location = basePath
							+ 'webdoc/editTypeTag.do?docid=2c902a8d6dc8c1da016dc9c039e80457';
				});
		//下载知识到本地
		$('#downPdfButtonId').bind(
				'click',
				function() {
					window.location = basePath
							+ 'webdoc/FLDownloadJsPDF.do?docid=2c902a8d6dc8c1da016dc9c039e80457';
				});
		//设置知识摘要
		$('#editDocdescribeButtonId').bind(
				'click',
				function() {
					window.location = basePath
							+ 'webdoc/editDocdescribe.do?docid=2c902a8d6dc8c1da016dc9c039e80457';
				});
		//设置自定義權限
		$('#setDocPopButtonId').bind(
				'click',
				function() {
					window.location = basePath
							+ 'webdoc/editDocPop.do?docid=2c902a8d6dc8c1da016dc9c039e80457';
				});
		//设置知识置顶到分类(前台只有超管可配)
		$('#setTypeTopId').bind(
				'click',
				function() {
					window.location = basePath
							+ 'webdoc/goTypeTopPage.do?docid=2c902a8d6dc8c1da016dc9c039e80457';
				});
		//设置或取消知识精华
		$('#setEssenceId').bind(
				'click',
				function() {
					window.location = basePath
							+ 'webdoc/goEssencePage.do?docid=2c902a8d6dc8c1da016dc9c039e80457';
				});
		//设置知识积分
		$('#setDocCoinsButtonId').bind(
				'click',
				function() {
					window.location = basePath
							+ 'webdoc/editDocCoin.do?docid=2c902a8d6dc8c1da016dc9c039e80457';
				});
		//知识积分兑换信息
		$('#listDocCoinsButtonId').bind(
				'click',
				function() {
					window.location = basePath
							+ 'webdoc/listDocCoin.do?docid=2c902a8d6dc8c1da016dc9c039e80457';
				});
		$('#addRelationFile')
				.bind(
						'click',
						function() {
							window.location = basePath
									+ 'webfile/add.do?docId=2c902a8d6dc8c1da016dc9c039e80457&flag=OUTRELATION';
						});
		$('#delTopButtonId').bind(
				'click',
				function() {
					if (confirm("删除后该知识将无法恢复，确定要删除吗？")) {
						window.location = basePath
								+ 'webdoc/FLDelKnow.do?id=2c902a8d6dc8c1da016dc9c039e80457';
					}
				});
		$('#publickButtonId').bind(
				'click',
				function() {
					if (confirm("是否要将该文档开放阅读和编辑权限到分类下，同时如果是小组文档将删除小组所有权？")) {
						window.location = basePath
								+ 'webdoc/FLflyKnow.do?id=2c902a8d6dc8c1da016dc9c039e80457';
					}
				});
		//下载知识到本地
		$('#downKnowButtonId')
				.bind(
						'click',
						function() {
							if (confirm("下载过程可能持续一段时间，是否继续下载？")) {
								window.location = basePath
										+ 'webdoc/FLDownloadKnow.do?docid=2c902a8d6dc8c1da016dc9c039e80457&safecode=2c902a8d6dc8c1da016dc9c039e80456';
							}
						});
		//站内推送
		$('#sendButtonId')
				.bind(
						'click',
						function() {
							window.location = basePath
									+ 'webusermessage/FLmanySendKnow.do?id=2c902a8d6dc8c1da016dc9c039e80457&type=know';
						});
		//链接分享
		$('#shareButtonId')
				.bind(
						'click',
						function() {
							window.location = basePath
									+ 'webshare/sharedoc.do?id=2c902a8d6dc8c1da016dc9c039e80457&type=know';
						});
		//关注
		$('#enjoyId')
				.live(
						'click',
						function() {
							$
									.post(
											'webdoc/enjoy.do?id=2c902a8d6dc8c1da016dc9c039e80457',
											function(flag) {
												if (flag.commitType == '0') {
													alert('关注成功');
													var buttonStr = '<button type="button" id="disEnjoyId" class="btn btn-default  btn-xs"><span class="glyphicon glyphicon-star"></span>&nbsp;取消关注</button>';
													$('#enjoyId').before(
															buttonStr);
													$('#enjoyId').remove();
												} else {
													alert('关注失败');
												}
											}, 'json');
						});
		//取消关注
		$('#disEnjoyId')
				.live(
						'click',
						function() {
							$
									.post(
											'webdoc/FLunEnjoy.do?id=2c902a8d6dc8c1da016dc9c039e80457',
											function(flag) {
												if (flag.commitType == '0') {
													alert('取消关注成功');
													var buttonStr = '<button type="button" id="enjoyId" class="btn btn-default  btn-xs"><span class="glyphicon glyphicon-star-empty"></span>&nbsp;关注</button>';
													$('#disEnjoyId').before(
															buttonStr);
													$('#disEnjoyId').remove();
												} else {
													alert('取消关注失败');
												}
											}, 'json');
						});
	});
</script>
		
		
	</div>
</div>
<!-- 展示知识内容 -->
<div class="row ">
	<div class="col-md-12">
        <div class="doc_title">{{ article.title }}</div>
		<div class="doc-conentinfo">
			

<!-- 知识信息页面顶部展示积分图标 -->

	
	

            作者: {{ article.author.username }}
			于
            {{ article.create_time|date:"Y-m-d H:i:s" }}
			<b>发布在分类</b>
			
					/
                    <a href="{% url 'category' article.category.pk %}">{{ article.category }}</a>
			
					/
                    <a href="{% url 'category' article.category.pk article.subcategory.pk %}">{{ article.subcategory }}</a>
			




<a name="markdocTag"></a>
	<div class="row">
		<div class="col-md-12 text-left" style="margin-top: 8px;margin-bottom: 4px;">
            {% for tag in article.tags.all %}
                <span class="label label-default " >{{ tag }}</span>
            {% endfor %}
			
		</div>
	</div>
			

<style>
.wcp-doc-rsg {text-align: center;}
.wcp-doc-ricon {width: 64px;height: 64px;border: 1px dashed #d1d1d1;margin: 4px;z-index: 2;padding: 4px;background-color: #ececec;}
.wcp-doc-ricon:HOVER {border: 1px dashed #d1d1d1;padding: 2px;}
</style>
<div class="wcp-doc-rsg">
	<div style="margin: auto; margin: 20px;">
		
		
	</div>
</div>

			
		</div>
		<!-- 当前版本就是待审核版本，且当前知识是待审核状态-->
		
	</div>
</div>

	<div class="row">
		<div class="col-md-12">
			




<!-- 知识信息页面中type为3时，free支付的控件 -->

	


		</div>
	</div>

<div class="row" style="margin-left: -18px; margin-right: -18px;">
	<!-- 当前版本就是待审核版本，或者知识非审核状态 -->
	
		<div class="col-md-12" id="docContentsId">
			<!-- 自定义表单展示 -->
			
			<hr style="clear: both; margin-bottom: 20px; border-top: dashed 1px #ddd;">
			<div class="ke-content currentVersion">
                {% if article.thumbnail %}
                    <img src="{{ article.thumbnail.url }}" alt="">
                {% endif %}
                
                {{ article.content }}

			</div>
			
				<hr style="clear: both;">
				<div style="padding-top: 16px;">
				</div>
			
		</div>
	
	<!-- 知识当前版本和审核版本不同，且，审核版本存在(文章是待审核状态) -->
	
</div>

</div>
						<div class="panel-body">
							<div class="row">
								<div class="col-md-12">
									<!-- 知識評價 -->
									


<div style="text-align: center;">
	<a name="markDocPrice"></a><br>
	


<style>
<!--
.wcp-userjudge-users {
	text-align: center;
}

.wcp-userjudge-users img {
	max-width: 32px;
	max-height: 32px;
	margin: auto;
	margin: 4px;
}
-->
</style>


<script type="text/javascript">
	$(function() {
		var posting = false;
		$('#btnPraiseOkId').bind('click', function() {
			if (posting) {
				return;
			}
			$('#textLablePraiseNumId').text("...");
			posting = true;
			$.post('webdoc/PubPraiseYes.do', {
				id : '2c902a8d6dc8c1da016dc9c039e80457'
			}, function(flag) {
				posting = false;
				if (flag.STATE == '0') {
					$('#textLablePraiseNumId').text(flag.runinfo.evaluate);
					$('#praiseyesNumId').text(flag.runinfo.praiseyes);
					$('#praisenoNumId').text(flag.runinfo.praiseno);
				} else {
					alert(flag.MESSAGE);
				}
			}, 'json');
		});
		$('#btnPraiseNoId').bind('click', function() {
			if (posting) {
				return;
			}
			$('#textLablePraiseNumId').text("...");
			posting = true;
			$.post('webdoc/PubPraiseNo.do', {
				id : '2c902a8d6dc8c1da016dc9c039e80457'
			}, function(flag) {
				posting = false;
				if (flag.STATE == '0') {
					$('#textLablePraiseNumId').text(flag.runinfo.evaluate);
					$('#praiseyesNumId').text(flag.runinfo.praiseyes);
					$('#praisenoNumId').text(flag.runinfo.praiseno);
				} else {
					alert(flag.MESSAGE);
				}
			}, 'json');
		});
		loadTypeJudge();
	});
	function loadTypeJudge() {
		//$('#doctypeJudgesId').text('loadding...');
		$('#doctypeJudgesId').load('webjudge/PubDocJudges.do', {
			'docid' : '2c902a8d6dc8c1da016dc9c039e80457'
		});
	}
</script>
</div>
<hr style="margin-top: 20px;border: 0px;">
									



<div class="row doc_column_box">
    <div class="col-sm-12">
        <span class="glyphicon glyphicon-comment  column_title">&nbsp;最新评论</span>
    </div>
</div>


<div class="col-md-12" id="newCommentBoxId">



    <style>
<!--
.list-group {
    margin-top: 8px;
}

.list-group .list-group-item {
    background-color: #ffffee;
}
            -->
    </style>
    <div class="row">
        <div class="col-sm-12">

            <div class="col-sm-12">
                <hr class="hr_split">
            </div>
            <div class="col-sm-12 doc_node">


                {% for comment in article.comment_set.all %}
                <div class="media message_boxunit">
                    <div class="media-body">
                        <div class="side_unit_info">
                            <div class="side_unit_info">
                                <span class="side_unit_info"> 
                                    {{ comment.author }}
                                    {{ comment.create_time|date:"Y-m-d H:i:s" }}
                                </span>
                            </div>
                            <div class="doc_node_content" style="margin: 4px;">
                                {{ comment.content }}
                            </div>
                        </div>
                    </div>
                </div>
                {% endfor %}


            </div>

            <div class="col-sm-12">
                <hr class="hr_split">
            </div>

        </div>
    </div>
</div>













<a name="markdocMessage"></a>
<!--<br /><div class="row doc_column_box">
	<div class="col-sm-12">
	 <span class="glyphicon glyphicon-comment  column_title">&nbsp;评论当前知识</span>
	</div>
</div> -->
<div class="row">
	<div class="col-md-12">
		<hr class="hr_split">
        <form  action="{% url 'comment' article.pk %}" class="wcp_noEnterSubmit" method="post">
            {% csrf_token %}
			<div class="row">
				<div class="col-md-12">
					<div class="form-group">
						
                        <textarea class="form-control" name="content" {% if not request.session.logged_in %}disabled placeholder="请登陆后发表评论" {% endif %}></textarea>
						
						
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-md-12 text-center">

					{% if not request.session.logged_in %}
                        <a href="{% url 'login' %}?url={{ request.path_info }}" class="btn btn-primary">登陆后发表评论</a>
                    {% else %}
                        <button class="btn btn-primary">发表评论</button>
                    {% endif %}
					
				</div>
			</div>
		</form>
	</div>
</div>
<script type="text/javascript">
	$(function() {
		$('#msgSubmitButtonId').bind('click', function() {
			if (!validate('knowSubmitFormId')) {

			} else {
				$('#knowSubmitFormId').submit();
				$('#msgSubmitButtonId').addClass("disabled");
				$('#msgSubmitButtonId').text("提交中...");
			}
		});
		validateInput('mesTextId', function(id, val, obj) {
			// 留言
			if (valid_isNull(val)) {
				return {
					valid : false,
					msg : '评论内容不能为空'
				};
			}
			if (valid_maxLength(val, 1024)) {
				return {
					valid : false,
					msg : '长度不能大于' + 1024
				};
			}
			return {
				valid : true,
				msg : '正确'
			};
		});
	});
</script>
								</div>
							</div>
						</div>
					</div>
					<div style="margin-top: 20px;"></div>
				</div>
				<div class="col-md-2  visible-lg visible-md">
				</div>
			</div>
			<div class="row column_box">
				<div class="col-md-12"></div>
			</div>
		</div>
	</div>
	<a name="markdocbottom"></a>
	



<div class="super_contentfoot  hidden-xs" style="margin: 0px;">
	<div class="container ">
		<div class="row">
			<div class="col-sm-1">



<style>
/* tooltip */
#tooltip {
	position: absolute;
	border: 1px solid #fff;
	background: #fff;
	padding: 3px 3px 3px 3px;
	color: #333;
	display: none;
}
</style>
<div class="row">
	<div class="col-sm-12  visible-lg visible-md" style="text-align: center;">
		<div>
			</a>
		</div>
	</div>
</div>
<script>
	$(function() {
		var towcodelinkurl = location.href;
		$('.towcodelink').attr('href', towcodelinkurl);
		initTowCodeTooltip('.towcodeTooltipfalg',
				'http://demo.wcpdoc.com:80/home/PubQRCode.do', -170, 20);
		initTowCodeTooltip('.towcodeTooltipfalgOpposite',
				'http://demo.wcpdoc.com:80/home/PubQRCode.do', 0, -175);
	});
	function initTowCodeTooltip(objKey, imgurl, x, y) {
		$(objKey)
				.live(
						'mouseover',
						function(e) {
							this.imgTitle = this.title;
							this.title = "";
							var imgTitle = this.imgTitle ? "<br/>"
									+ this.imgTitle : "";
							var tooltip = "<div id='tooltip'><img style='max-width: 150px;' src='"+ imgurl +"' alt='预览图'/>"
									+ imgTitle + "<\/div>"; //创建 div 元素
							$("body").append(tooltip);
							$("#tooltip").css({
								"top" : (e.pageY + y) + "px",
								"left" : (e.pageX + x) + "px"
							}).show("fast"); //设置x坐标和y坐标，并且显示
						});

		$(objKey).live('mouseout', function(e) {
			this.title = this.imgTitle;
			$("#tooltip").remove();
		});
		$(objKey).live('mousemove', function(e) {
			$("#tooltip").css({
				"top" : (e.pageY + y) + "px",
				"left" : (e.pageX + x) + "px"
			});
		});
	}
</script></div>
			<div class="col-sm-11 putServerBox">
				<ul id="recommendServiceList" class="footServerUl">
					
					
				</ul>
			</div>
		</div>
	</div>
</div>
	


<div class="foot">
    Share Cheese
	
</div>
<script type="text/javascript">
	$(function() {
		$(window).resize(function() {
			$('.containerbox').css('min-height', $(window).height() - 170);
		});
		$('.containerbox').css('min-height', $(window).height() - 170);
	});
</script>
	


</body></html>
